
#ifndef REPING_USER_H
#define REPING_USER_H

/** I N C L U D E S **********************************************************/
#include "GenericTypeDefs.h"
#include "usb_config.h"

#define mInitButton1()		TRISBbits.TRISB5=1;

#define clearInterrupt()		INTCONbits.RBIF=0; // Clear RB Port Change Interrupt Flag bit
#define enableInterrupt()		INTCONbits.RBIE=1; 	// Enables the RB port change interrupt
#define clearTimerInterrupt()	INTCONbits.T0IF=0;		//Clear Timer interrupt
#define enableTimerInterrupt()	INTCONbits.TMR0IE=1; 	//Enables the Timer0 interrupt
#define enableADCInterrupt()	PIE1bits.ADIE = 1;		//Enables the ADC interrupt
#define setADCInterruptPrioHigh() IPR1bits.ADIP = 1;
#define clearADCInterrupt()		PIR1bits.ADIF = 0;		//Clear ADC interrupt
#define enableGlobalInterrupt()	INTCONbits.GIE=1;
#define enableTimer()			T0CON = 0b10010101;
#define enableTimeCounter()		T1CON = 0b11111101;
#define enableADC()				ADCON0bits.ADON = 1;
#define startADC()				ADCON0bits.GO = 1;
#define selectADCChannel0()		ADCON0 = 0b00000000; 
#define setupADC()				ADCON1 = 0b00001110;
//#define setupTimer()			TMR0H=0b00001111; TMR0L=0b11111111;


#define button1				PORTBbits.RB5

/** S T R U C T U R E S ******************************************************/
typedef union DATA_PACKET
{
    BYTE _byte[USBGEN_EP_SIZE];  
     struct
    {
        BYTE length;
        BYTE data[USBGEN_EP_SIZE-1];
    };
} DATA_PACKET;

//typedef struct CHUNK
//{
//	BYTE value;
//	BYTE time;
//} CHUNK;
//
//typedef union DATA_KOMBI_PACKET
//{
//	BYTE _byte[USBGEN_EP_SIZE];
//	struct
//	{
//		BYTE	length;
//		CHUNK	data[(USBGEN_EP_SIZE-1)/sizeof(CHUNK)];
//	};
//} DATA_KOMBI_PACKET;

/** P U B L I C  P R O T O T Y P E S *****************************************/
void UserInit(void);
void ProcessIO(void);

#endif 

